package chapter1;

import org.bouncycastle.jce.provider.BouncyCastleProvider;

import java.security.Security;

/**
 * Created by Ainge on 2019/12/5
 */
public class BouncyCastleSupport {
    private static volatile boolean support = false;

    public static void support() {
        if (!support) {
            synchronized (BouncyCastleSupport.class) {
                if (!support) {
                    if (Security.getProvider("BC") == null) {
                        Security.addProvider(new BouncyCastleProvider());
                    }
                    support = true;
                }
            }
        }
    }

    public static void main(String[] args) {
        System.out.println("asd");
    }
}
